﻿using KxParser.Lexer.Common;
using KxParser.Parser.LR0;
using System.Linq;

namespace KxParser
{
    public static class Global
    {
		public static char RuleItemSeparator {get{return ' ';}}
        public static string Equalator { get { return " -> "; } }
        public static string Demarkator { get { return "@"; } }
        public static string Starter { get { return "S'"; } }
        public static string Ender { get { return "$"; } }
		public static string TokenNameSeparator { get { return "\t"; } }
        public static string EmptyCell { get { return ""; } }
        public static string ErrorCell { get { return "e"; } }
        public static string ErrorTokenName { get { return "ERR"; } }

        public static string[] LexerReservedWords { get { return new[] {ErrorTokenName, Ender, Demarkator, TokenNameSeparator}; } }

        public static string[] Terminals { get; set; }

        public static string[] NonTerminals { get; set; }

        public static ProductionItem[] ProductionItems { get; set; }

        public static Token[] InputTokens { get; set; }


		public static bool IsNonTerminal(string value)
		{
			var q = Global.NonTerminals.FirstOrDefault(nonTerminal => nonTerminal.Equals(value)) != null;
			return q;
		}
    }
}
